import request from "@/utils/request";

const BASE_URL = "/admin-api/menu";

class MenuAPI {
  static getMenuList() {
    return request<any, any>({
      url: `${BASE_URL}/treeList`,
      method: "get",
    });
  }

  static updateMenu(data: any) {
    return request<any, any>({
      url: `${BASE_URL}/update`,
      method: "post",
      data,
    });
  }

  static deleteMenu(id: number) {
    return request<any, any>({
      url: `${BASE_URL}/delete/${id}`,
      method: "post",
    });
  }

  static createMenu(data: any) {
    return request<any, any>({
      url: `${BASE_URL}/create`,
      method: "post",
      data,
    });
  }
}

export default MenuAPI;
